﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using Century.Web.UI.MVC;
using Century.Model.ViewModel;
using Century.EnterpriseLibrary.Configuration;
using Century.Business.CMS;

namespace Century.Admin.Controllers
{
    public class FileExplorerController : CenturyAdminBaseController
    {
        public FileExplorerController(ISiteService siteService) : base(siteService) { }
        public ActionResult Index(string sitepath, string targetName)
        {
            FileExplorerViewModel model = new FileExplorerViewModel();
            string path = sitepath;
            if (string.IsNullOrEmpty(sitepath))
            {
                path = "~/Content/themes/default/img/banner/page_header";//ConfManager.Instance.FileExplorer.DefaultPath.ConfigValue;
            }
            
            model.Path = path;
            model.TartgetElementId = targetName;
            model.ExplorerID = Guid.NewGuid().ToString();

            return View("Index", "", model);
        }

        public ActionResult FileTree(FileExplorerViewModel viewModel)
        {
            return View("FileTree", "", viewModel);
        }
    }
}
